from django.conf.urls.defaults import *
from django.conf import settings
from django.views.generic.simple import direct_to_template


# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    # (r'^treedata/', include('treedata.foo.urls')),
    (r'^admin/(.*)', admin.site.root),
    url(r'^$', 'trees.views.home',name="home"),    
    url(r'^stats$', 'trees.views.stats',name="stats"),    
    url(r'^find$', 'trees.views.plants_index',name="plants_index"),    
    url(r'^request$', 'trees.views.new_plant',name="new_plant"),                
    url(r'^plants/?$', 'trees.views.plants_all',name="plants_all"),     
    url(r'^plant/rx/(?P<plant_id>[\d]+)$', 'trees.views.plant_rx',name="plant_rx"),    
    url(r'^plant/(?P<plant_id>[\d]+)$', 'trees.views.plant_detail',name="plant_detail"),                    
    url(r'^species/(?P<species_id>[\d]+)$', 'trees.views.species_detail',name="species_detail"),                    
    url(r'^species/?$', 'trees.views.species_all',name="species_all"),     
)


# Use django static view for development
if settings.DEBUG:
    urlpatterns += patterns('',
        ( 
            r'^media/(?P<path>.*)$', 
            'django.views.static.serve', 
            {'document_root': settings.MEDIA_ROOT}),    
        )
